package dragonantithesis.dragonantithesis;

import eos.moe.dragoncore.api.ModelAPI;
import io.lumine.xikage.mythicmobs.adapters.AbstractEntity;
import io.lumine.xikage.mythicmobs.io.MythicLineConfig;
import io.lumine.xikage.mythicmobs.skills.SkillMechanic;
import io.lumine.xikage.mythicmobs.skills.SkillMetadata;
import org.bukkit.entity.Entity;

public class MythicmobsModelSet extends SkillMechanic {
    String modelName;
    public MythicmobsModelSet(String skill, MythicLineConfig mlc) {
        super(skill,mlc);
        this.ASYNC_SAFE = false;
        this.modelName = mlc.getString(new String[]{"modelName","mn","mid","modelid","m"}, "模型名字");
    }

    public boolean cast(SkillMetadata data) {
        return this.castSkill(data, (AbstractEntity)null);
    }

    public boolean castAtEntity(SkillMetadata data, AbstractEntity target) {
        return this.castSkill(data, target);
    }

    boolean castSkill(SkillMetadata data, AbstractEntity e1) {
        Entity bukkitEntity = e1.getBukkitEntity();
        ModelAPI.setEntityModel(bukkitEntity.getUniqueId(),modelName);
        return true;
    }
}
